package com.google.code.sapwcrawler.urlfilter;
import java.util.*;
import java.net.*;

public class PathFilter implements URLFilter
{
	private Set<String> paths;
	public PathFilter(Set<String> paths)
	{
		this.paths = Collections.synchronizedSet(paths);
	}
	
	public boolean isDownloadableURL(URL url)
	{
		String curPath = url.getPath();
		for(String path: paths)
			if(curPath.startsWith(path))
				return false;
		return true;
	}
}
